package com.itany.shop.service;

import com.itany.shop.entity.Order;
import com.itany.shop.entity.User;
import com.itany.shop.exception.RequestParameterErrorException;
import com.itany.shop.exception.ServiceException;
import com.itany.shop.exception.UserNotLoginException;
import com.itany.shop.vo.Cart;

import java.util.List;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/4/19 10:25
 * Version:1.0-SNAPSHOT
 * Description:
 */
public interface OrderService {

    /**
     * 生成订单
     * @param cart
     * @param user
     * @return 返回生成的订单号
     */
    public String createOrder(Cart cart, User user) throws UserNotLoginException, ServiceException;

    /**
     * 查询我的订单
     * @param user
     * @return
     */
    public List<Order> findMyOrders(User user) throws ServiceException, UserNotLoginException;

    /**
     * 查询订单详情
     * @param id
     * @return
     */
    public Order findDetail(String id) throws RequestParameterErrorException, ServiceException;
}
